From: Gerd Moellmann Date: Tue, 10 Jul 2001 12:19:10 +0000 (+0000) Subject: (Fx_create_frame): Initialize frame colors to -1, X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~62800 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=cefecbcf1d9e2c5e48c4d6dd7b69841855a6684c;p=emacs.git (Fx_create_frame): Initialize frame colors to -1, for the case that x_decode_colors signals an error. --- diff --git a/src/xfns.c b/src/xfns.c index 1f4fb43dda8..0d66c03e235 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4182,6 +4182,16 @@ This function is an internal primitive--use `make-frame' instead.") { Lisp_Object black; struct gcpro gcpro1; + + /* Function x_decode_color can signal an error. Make + sure to initialize color slots so that we won't try + to free colors we haven't allocated. */ + f->output_data.x->foreground_pixel = -1; + f->output_data.x->background_pixel = -1; + f->output_data.x->cursor_pixel = -1; + f->output_data.x->cursor_foreground_pixel = -1; + f->output_data.x->border_pixel = -1; + f->output_data.x->mouse_pixel = -1; black = build_string ("black"); GCPRO1 (black);